import './style/index.less'


// import { SkySteps, SkyStepItem } from './packages/ArticleSteps/'
import { SkyDropdown, SkyDropdownItem } from './packages/Dropdown/'
import { SkyTable, SkyColumn } from './packages/Table/'
import { SkyMatrix, SkyMatrixRow, SkyMatrixCol } from './packages/Matrix/'
import { SkyPanel } from './packages/Panel/'
import { SkyDialog } from './packages/Dialog/'
import { SkyCollapseTransition } from './packages/CollapseTransition/'
import { SkyFoldingPanel } from './packages/FoldingPanel/'
import { SkyCodePanel } from './packages/CodePanel/'
import { SkyCard } from './packages/Card/'
import { SkyCountTo } from './packages/CountTo/'
import { SkyOutSideWrap } from './packages/OutSideWrap/'
import { SkyTreeSelect } from './packages/TreeSelect/'
// import { SkyPanelPositionGroup, SkyPanelPositionUnit } from './packages/PanelPosition/'

import { SkyTreeTable, SkyTreeColumn } from './packages/TreeTable/'
import { SkyRadio, SkyRadioGroup } from './packages/Radio/'
import { SkyCheckbox, SkyCheckboxGroup  } from './packages/Checkbox/'

import thousands from './command/thousands-directive'
import debounce from './command/debounce-directive'
import verify from './command/verify-directive'
import waterMarker from './command/water-marker-directive'
import rate from './command/rate-directive'
import Message from './packages/Message/'

import {useScrollToErrorFormItem} from "./hooks/useScrollToErrorFormItem"

import minxins from './minxins'
const components = [
  // SkySteps, SkyStepItem,
  SkyDropdown, SkyDropdownItem,
  SkyMatrix, SkyMatrixRow, SkyMatrixCol,
  SkyTable, SkyColumn,
  SkyPanel,
  SkyDialog,
  SkyCard,
  SkyCollapseTransition,
  SkyFoldingPanel,
  SkyCodePanel,
  // SkyPanelPositionGroup, SkyPanelPositionUnit,
  SkyTreeTable, SkyTreeColumn,
  SkyRadio, SkyRadioGroup,
  SkyCheckbox, SkyCheckboxGroup,
  SkyCountTo,
  SkyOutSideWrap,
  SkyTreeSelect
]

const install = function(app:any, opts = {}) {
  components.forEach(component => {
    app.component(component.name, component)
  })

  // 注册
  app.directive('thousands', thousands)
  app.directive('debounce', debounce)
  app.directive('verify', verify)
  app.directive('waterMarker', waterMarker)
  app.directive('rate', rate)

  // 注册hooks
  app.provide('useScrollToErrorFormItem',useScrollToErrorFormItem)


  app.mixin(minxins)
}

export {
  Message
}

export default install
